{itemplate 'public/header'}
<div class="page store shopping shopcategory" id="page-app-goods">
	<nav class="bar bar-tab no-gutter shop-cart-bar">
		<div class="" id="cartEmpty">
			<div class="left empty">
				<span class="cart">
					<span class="icon icon-cart"></span>
				</span>
				购物车是空的
			</div>
			<div class="right text-center bg-grey">{$store['send_price']}元起送</div>
		</div>
		<div class="hide" id="cartNotEmpty">
			<div class="left">
				<span class="cart">
					<span class="icon icon-cart"></span>
					<span class="badge bg-danger" id="cartNum">0</span>
				</span>
				共<span class="sum">￥<span id="totalPrice">0</span>元</span>
			</div>
			<div class="right text-center bg-grey" id="categoryCondition">还差￥0元起送</div>
			<div class="right text-center bg-grey">还差￥<span id="sendCondition">{$store['send_price']}</span>元起送</div>
			{if !$store['is_in_business_hours']}
				<div class="right text-center bg-grey hide" id="btnSubmit">休息中</div>
			{else}
				<div class="right text-center bg-danger hide" id="btnSubmit">选好了</div>
			{/if}
		</div>
	</nav>
	{if !empty($activity['items']['discount'])}
		<div class="store-discount-notice">
			<div class="inner">{$activity['items']['discount']['title']}</div>
		</div>
	{elseif !empty($activity['items']['grant'])}
		<div class="store-discount-notice">
			<div class="inner">{$activity['items']['grant']['title']}</div>
		</div>
	{/if}
	<header class="bar bar-nav common-bar-nav">
		<a class="pull-left back" href="javascript:;"><i class="icon icon-arrow-left"></i></a>
		<h1 class="title open-popup" data-popup=".popup-privilege">{$store['title']}</h1>
		<a class="pull-right" href="javascript:;" style="margin-left: 5px"><i class="icon icon-search"></i></a>
		<a class="pull-right" href="javascript:;" id="btn-favorite" data-id="{$store['id']}" data-uid="{$_W['member']['uid']}">
			<i class="fa {if !empty($is_favorite)}icon icon-favorfill{else}icon icon-favor{/if}"></i>
		</a>
	</header>
	<div class="store-notice open-popup" data-popup=".popup-privilege">
		<span class="js-scroll-notice">
			<span class="icon icon-voice"></span>
			{if !empty($store['notice'])}
				{$store['notice']}
			{else}
				营业时间: {$store['business_hours_cn']}
			{/if}
		</span>
	</div>
	<div class="buttons-tab">
		<a href="{php echo imurl('wmall/store/goods', array('sid' => $store['id']));}" class="button active">商品</a>
		<a href="{php echo imurl('wmall/store/comment', array('sid' => $store['id']));}" class="button">评价</a>
		<a href="{php echo imurl('wmall/store/index', array('sid' => $store['id']));}" class="button">车主</a>
		{if !empty($store['sns']['qq'])}
			<a href="http://wpa.qq.com/msgrd?v=3&uin={$store['sns']['qq']}&site=qq&menu=yes" class="button">客服</a>
		{/if}
	</div>
	<div class="content lazyload-container" style="z-index: 10199">
		{if !empty($tokens)}
			<div class="coupon-show-container">
				<div class="coupon-show">
					<div class="coupon-sum">
						<span>￥</span>{$token_price}
					</div>
					<div class="division">
						<img src="{WE7_WMALL_TPL_URL}static/img/division.png" alt="" />
					</div>
					<div class="coupon-info">
						<div class="coupon-title">车主代金券</div>
						{if $token_nums > 1}
							<div class="condition">内含{$token_nums}张券</div>
						{else}
							<div class="condition">满{$token['condition']}元可用</div>
						{/if}
					</div>
					<div class="get">
						<span class="btn-get" id="get-coupon">领券</span>
					</div>
				</div>
			</div>
		{/if}
		<div class="goods-category">
			<div class="goods-category-title">商品分类</div>
			<div class="goods-category-con row no-gutter">
				{loop $categorys $category}
					{php $i++}
					<a href="javascript:;" data-id="{$category['id']}" class="col-33 category-row {if $i >= 6}hide{/if}">{$category['title']}</a>
				{/loop}
				{if $i > 5}
					<a href="javascript:;" class="col-33" id="category-toggle">更多 <i class="icon icon-arrow-down"></i></a>
				{/if}
			</div>
		</div>
		<div class="selection-goods" id="category-container">
			<form action="{php echo imurl('wmall/order/create/goods', array('sid' => $sid));}" method="post" id="goods-form">
			<input type="hidden" name="goods" value=""/>
			{loop $categorys $cate_row}
				{if !empty($cate_goods[$cate_row['id']])}
					<div class="selection-goods-title">{$cate_row['title']}</div>
					<div class="selection-goods-con row no-gutter">
						{loop $cate_goods[$cate_row['id']] $ds}
							<div class="col-33 goods-item" id="goods-{$ds['id']}">
								<a href="javascript:;" class="goods-popup" data-id="{$ds['id']}">
									<div class="goods-img">
										<img src="{WE7_WMALL_TPL_URL}static/img/hm.gif" class="lazyload" data-original="{php echo tomedia($ds['thumb']);}" alt="" />
										<span class="badge hide">0</span>
										{if !empty($ds['label'])}
											<span class="sale-badge bg-danger">{$ds['label']}</span>
										{/if}
									</div>
									<div class="goods-title">{$ds['title']}</div>
									<div class="sales">月售{$ds['sailed']}{$ds['unitname']}</div>
									<div class="price">
										<span class="fee"><span>￥</span>{$ds['discount_price']}</span>
										{if !empty($ds['bargain_id'])}
											<span class="original-fee">￥{$ds['price']}</span>
										{/if}
									</div>
								</a>
								{if $store['is_in_business_hours']}
									{if !$ds['is_options'] && !$ds['is_attrs']}
										{if !$ds['total']}
											<div class="goods-tips">已售完</div>
										{else}
											<div class="operate-num operate-goods">
												<span class="hide minus">
													<span class="icon icon-minus" data-goods-id="{$ds['id']}" data-option-id="0"></span>
													<span class="num">0</span>
												</span>
												<span class="icon icon-plus" data-goods-id="{$ds['id']}" data-option-id="0"></span>
											</div>
										{/if}
									{elseif $ds['is_options'] == 1 || $ds['is_attrs'] == 1}
										<div class="operate-goods">
											<span class="select-spec goods-option" data-id="{$ds['id']}">可选规格</span>
										</div>
									{/if}
								{/if}
							</div>
						{/loop}
					</div>
				{/if}
			{/loop}
			<div class="all-goods "><a href="javascript:;">已加载全部商品</a></div>
			</form>
		</div>
	</div>
</div>
{itemplate 'store/goodsCommon'}
{itemplate 'public/footer'}